//
//  cartoonBrief_intrdTableViewCell.m
//  A段项目,漫画
//
//  Created by dllo on 15/4/23.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "cartoonBrief_intrdTableViewCell.h"
#define WIDTH [[UIScreen mainScreen] bounds].size.width
@implementation cartoonBrief_intrdTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.brief_intrd = [[UILabel alloc] init];
        [self.contentView addSubview:self.brief_intrd];
        [self.brief_intrd release];
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    //根据对应的文字求出label显示需要的高度
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:14], NSFontAttributeName, nil];
    //根据文本大小(font)计算出文本的rect值,最大范围不超过(375,400)
    
    CGRect rect = [self.brief_intrd.text boundingRectWithSize:CGSizeMake(WIDTH, 400) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    self.brief_intrd.frame = CGRectMake(20, 5, WIDTH - 30, rect.size.height + 40);
    self.brief_intrd.numberOfLines = 0;
    self.brief_intrd.font = [UIFont systemFontOfSize:14];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
